#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 crane <crane@gosun>
#
# Distributed under terms of the MIT license.

"""

"""

import random

def random_add_test():
    total = 1000 * 1000

    odd_cnt = 0
    even_cnt = 0
    for i in range(total):
        first  = random.randint(0, 100)
        second = random.randint(0, 100)
        sum = (first + second) % 2
        if sum == 1: odd_cnt += 1
        if sum == 0: even_cnt += 1

    # 1:3
    return odd_cnt / total, even_cnt/total

def random_mul_test():
    total = 1000 * 1000

    odd_cnt = 0
    even_cnt = 0
    for i in range(total):
        first  = random.randint(0, 100)
        second = random.randint(0, 100)
        mul = (first * second) % 2
        if mul == 1: odd_cnt += 1
        if mul == 0: even_cnt += 1

    # 1:3
    return odd_cnt / total, even_cnt/total

def test():
    v = random_mul_test()
    print(v)

    v = random_add_test()
    print(v)

def main():
    print("start main")
    test()

if __name__ == "__main__":
    main()
